/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50715
 Source Host           : localhost
 Source Database       : examination

 Target Server Type    : MySQL
 Target Server Version : 50715
 File Encoding         : utf-8

 Date: 03/29/2017 23:42:17 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `tb_goods`
-- ----------------------------
DROP TABLE IF EXISTS `tb_goods`;
CREATE TABLE `tb_goods` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品表主键',
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '商品表标题',
  `summary` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '商品表摘要',
  `img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '商品表图片地址',
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '商品表正文',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '商品表价格',
  `tag` tinyint(3) unsigned NOT NULL COMMENT '是否已被购买过的标志位',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `tb_goods`
-- ----------------------------
BEGIN;
INSERT INTO `tb_goods` VALUES ('1', '他改变了中国', '蛤', 'http://images.ifunmac.com/wp-content/images/2017/tinycal.jpg', '闷声大发财', '1.00', '0'), ('2', '香港记者', '跑得快', 'http://images.ifunmac.com/wp-content/images/2017/tinycal.jpg', '董先生连任好不好啊', '1.00', '0'), ('3', '华莱士', '高', 'http://images.ifunmac.com/wp-content/images/2017/tinycal.jpg', '谈笑风生', '2.00', '1');
COMMIT;

-- ----------------------------
--  Table structure for `tb_order`
-- ----------------------------
DROP TABLE IF EXISTS `tb_order`;
CREATE TABLE `tb_order` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单表主键',
  `goods_id` bigint(20) unsigned NOT NULL COMMENT '商品主键',
  `count` bigint(20) unsigned NOT NULL COMMENT '订单表',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单的生成时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `tb_order`
-- ----------------------------
BEGIN;
INSERT INTO `tb_order` VALUES ('1', '3', '10', '2017-03-29 23:41:45');
COMMIT;

-- ----------------------------
--  Table structure for `tb_shoping_car`
-- ----------------------------
DROP TABLE IF EXISTS `tb_shopping_car`;
CREATE TABLE `tb_shopping_car` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '购物车表主键',
  `good_id` bigint(20) unsigned NOT NULL COMMENT '商品表主键',
  `count` int(10) unsigned NOT NULL COMMENT '购买商品的数量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tb_user`
-- ----------------------------
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户表',
  `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `tb_user`
-- ----------------------------
BEGIN;
INSERT INTO `tb_user` VALUES ('1', 'buyer', 'reyub'), ('2', 'seller', 'relles');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
